﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MTGenome.MTG
{
    public interface ILibrary
    {
        /// <summary>
        /// Any situation where a single card is removed from the top
        /// </summary>
        /// <returns>A card</returns>
        ICard Draw();

        /// <summary>
        /// Any situation where a single card is removed from the bottom
        /// </summary>
        /// <returns>A card</returns>
        ICard DrawFromBottom();

        /// <summary>
        /// Any situation where X cards are removed from the top
        /// </summary>
        /// <param name="X">number to draw</param>
        /// <returns>List of cards</returns>
        IEnumerable<ICard> DrawX(int X);

        /// <summary>
        /// Any situation where X cards are removed from the bottom
        /// </summary>
        /// <param name="X">number to draw</param>
        /// <returns>List of cards</returns>
        IEnumerable<ICard> DrawXFromBotton(int X);

        /// <summary>
        /// Views the top card but leaves it in the library
        /// </summary>
        /// <returns>A card</returns>
        ICard ViewTop();

        /// <summary>
        /// Views the bottom card but leaves it in the library
        /// </summary>
        /// <returns>A card</returns>
        ICard ViewBottom();

        /// <summary>
        /// Views the top X cards, leaving them in the library
        /// </summary>
        /// <param name="X">Number of cards to view</param>
        /// <returns>List of cards</returns>
        IEnumerable<ICard> ViewTopX(int X);

        /// <summary>
        /// Views the bottom X cards, leaving them in the library
        /// </summary>
        /// <param name="X">Number of cards to view</param>
        /// <returns>List of cards</returns>
        IEnumerable<ICard> ViewBottomX(int X);

        /// <summary>
        /// Views all cards in the library, make sure to shuffle afterwards
        /// </summary>
        /// <returns>List of cards</returns>
        IEnumerable<ICard> ViewAll();

        /// <summary>
        /// Places a card on top of the library
        /// </summary>
        /// <param name="card">A card</param>
        void PlaceOnTop(ICard card);

        /// <summary>
        /// Places a card on the bottom of the library
        /// </summary>
        /// <param name="card">A card</param>
        void PlaceOnBotton(ICard card);

        /// <summary>
        /// Shuffles the library, randomly
        /// </summary>
        void Shuffle();

        /// <summary>
        /// Loads the library for your initial deck
        /// </summary>
        /// <param name="cards"></param>
        void Load(IEnumerable<ICard> cards);

        /// <summary>
        /// Number of cards in the deck
        /// </summary>
        int CardCount
        {
            get;
        }
    }
}
